package com.ddatsh.httpinvoker.dao;

import javax.annotation.Resource;

import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.support.JdbcDaoSupport;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

@Repository
public class DBDao extends JdbcDaoSupport {
	@Resource
	public void setTemplate(JdbcTemplate jdbcTemplate) {
		super.setJdbcTemplate(jdbcTemplate);
	}

	@Transactional
	public void save() throws Exception {
		String sql = "delete from T_USER";
		getJdbcTemplate().update(sql);
		getJdbcTemplate().getDataSource().getConnection().commit();
//		throw new RuntimeException("aa");
		throw new Exception("aa");

	}
}
